/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-11-30
 * Time: 22:53
 */
public class TestH19 {
        public int lengthOfLastWord(String s) {
            char[] ch = s.trim().toCharArray();
            int len = 0;
            for(char c : ch) {
                if(c == ' ') {
                    len  = 0;
                }else {
                    len++;
                }
            }
            return len;
        }
}
